﻿function showNode(flowID, nodeID)
{
    var width = 400;
    var height = 376;

    if (isIE6)
    {
        height = height + 23;
    }
   
    var args = null;
    var sFeatures = "dialogHeight:" + height + "px;dialogWidth:" + width + "px;help=no; status=no; scroll=no; resizable=no;";
    var url = getAppPath() + "WorkFlow/Node/Edit.aspx?";

    var paras = "";
    if (flowID != null && flowID != "")
    {
        paras += "&FlowID=" + flowID;
    }
    if (nodeID != null && nodeID != "")
    {
        paras += "&PKID=" + nodeID;
    }

    url += paras.substr(1);

    return CreateDivFrm("设置节点", null, url, width, height);
    
   // return window.showModalDialog(url, args, sFeatures);
}

function showLine(flowID, lineID)
{
    var width = 400;
    var height = 266;
    
    if (isIE6)
    {
        height = height + 23;
    }
    
    var args = null;
    var sFeatures = "dialogHeight:" + height + "px;dialogWidth:" + width + "px;help=no; status=no; scroll=no; resizable=yes;";
    var url = getAppPath() + "WorkFlow/Line/Edit.aspx?";
    
    var paras = "";
    if (flowID != null && flowID != "")
    {
        paras += "&FlowID=" + flowID;
    }
    if (lineID != null && lineID != "")
    {
        paras += "&PKID=" + lineID;
    }

    url += paras.substr(1)

    return CreateDivFrm("设置路由", null, url, width, height);
    //return window.showModalDialog(url, args, sFeatures);
}

function showFlow(flowID)
{
    var width = 300;
    var height = 450;
    var args = null;
    var sFeatures = "dialogHeight:" + height + "px;dialogWidth:" + width + "px;help=no; status=no; scroll=no; resizable=yes;";
    var url = getAppPath() + "WorkFlow/Flow/Edit.aspx?FlowID" + flowID;   
    return window.showModalDialog(url, args, sFeatures);
}

function showDefaultUser(txtID, txtName, txtRoleID, txtUserID)
{
    if (typeof (txtID) == "string")
    {
        txtID = document.getElementById(txtID);
    }
    if (typeof (txtName) == "string")
    {
        txtName = document.getElementById(txtName);
    }
    if (typeof (txtRoleID) == "string")
    {
        txtRoleID = document.getElementById(txtRoleID);
    }
    if (typeof (txtUserID) == "string")
    {
        txtUserID = document.getElementById(txtUserID);
    }

    var args = new Array(2); //接受对话框返回值 

    args[0] = txtID.value;
    args[1] = txtName.value;


    var dialogUrl = "SelectDefaultUser.aspx?SelectID=" + args[0] + "&RoleIDs=" + txtRoleID.value + "&UserIDs=" + txtUserID.value;
   
    showDlg(dialogUrl, args);

    txtID.value = args[0];
    txtName.value = args[1];
    return false;
}
